import time
from distutils.command.check import check
from pickletools import long1
from time import sleep

from Tools.scripts.cleanfuture import dryrun
from Tools.scripts.find_recursionlimit import test_init
from selenium.webdriver.common import alert
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By

from common.com import forum, Driver
#帖子详情页面的测试
class prMe:
    url =""
    driver = ""
    def __init__(self):
        self.driver = forum.driver
        # self.url = "http://127.0.0.1:9580/index.html#"
        # self.driver.get(url=self.url)

    #进行私信发发送测试
    def prFunTest(self):
        #任意点击一个帖子给帖子的作者发私信
        self.driver.find_element(By.CSS_SELECTOR,"#artical-items-body > div:nth-child(1) > div > div.col > div.text-truncate > a").click()
        self.driver.find_element(By.CSS_SELECTOR,"#btn_details_send_message").click()
        time.sleep(2)
        #输入信息
        self.driver.find_element(By.CSS_SELECTOR,"#index_message_receive_content").send_keys("111111111")
        time.sleep(1)
        #点击发送
        self.driver.find_element(By.CSS_SELECTOR,"#btn_index_send_message").click()

        time.sleep(2)


# prMe = prMe()
# prMe.prFunTest()